#ifndef PARSER_H
#define PARSER_H
#include "allCommandStack.h"
#include "LogicProcess.h"
#include "DeleteProcess.h"
#include "AddProcess.h"
#include "allTaskList.h"
#include "UpdateProcess.h"
#include "UndoProcess.h"
#include "RedoProcess.h"
#include "SearchProcess.h"
#include "EditProcess.h"

static const string ADD="add";
static const string DELETE="delete";
static const string EDIT="edit";
static const string UDATE="update";
static const string UNDO="undo";
static const string REDO="redo";
static const string SELECT="select";
static const string EXIT="exit";
static const string SEARCH="search";
#include <string>
#include <iostream>
using namespace std;

//This class intepret the command string and returns the appropiate processor to the logic
class Parser{
private:
	allTaskList *allTask;
	string commandString;
	LogicProcess *Processor;
	allCommandStack *prevCmds;
public:
	Parser();

	LogicProcess* processCommand(string cmd,allTaskList *givenLists,allCommandStack *givenStacks);
	string takeContent(string commandString,string command);
	LogicProcess* solveTheCommand(commandType type,string content);
	string takeFirstWord(string tmp);
	commandType detectCommandType(string command);
	
};
#endif